package cn.com.weather.nf.repository;

import java.io.Serializable;
import java.util.List;

import cn.com.weather.nf.entity.RecordForm;
import cn.com.weather.nf.entity.RecordWeather;
import cn.com.weather.nf.entity.TemplateInstances;

public interface SimpleRepository {


    <T> T findById(Class<T> type, Serializable id);

    Integer findListTotal(Class<?> beanClass);

    <T> List<T> findListOrderById(Class<T> beanClass, Integer current, Integer pageSize);

    void delete(Class<?> type, Long id);

    /**
     * 
     * @param type
     * @return
     */
    Integer findRecordFormListTotal(String type, String from, Integer instanceId, String search, long beginTime, long endTime);

    /**
     * 
     * @param type
     * @param current
     * @param pageSize
     * @return
     */
    List<RecordForm> findRecordFormListOrderById(String type, String from, Integer current, Integer pageSize,
                                                 Integer instanceId, String search,
                                                 long beginTime, long endTime);

    /**
     * 
     * @param from
     * @return
     */
    Integer findRecordWeatherListTotal(String from);

    /**
     * 
     * @param from
     * @param current
     * @param pageSize
     * @return
     */
    List<RecordWeather> findRecordWeatherListOrderById(String from, Integer current, Integer pageSize);

    /**
     * 
     * @param origin
     */
    void update(Object origin);

    /**
     *
     * @param type yijian | wenti | tianqi
     */
    List<TemplateInstances> findAllTemplateInstances(String type);
}

